home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
patches
/
ami301c.zip
/
QKQUAD.SM$
/
QKQUAD.SMM
Wrap
INI File
|
1993-05-17
|
18KB
|
1,206 lines
[ver]
4
[sty]
_DEFAULT.STY
[files]
[charset]
82
ANSI (Windows, IBM CP 1252)
[revisions]
0
[prn]
QMS-PS 810
[port]
LPT1:
[lang]
1
[desc]
Calculates real solutions for the Quadratic equation.
737684644
13
733695425
522
6
0
0
0
0
1
[fopts]
0
1
0
0
[lnopts]
2
Body Text
1
[docopts]
5
2
[GramStyle]
[ParaNum]
1
[tag]
Body Text
2
[fnt]
Times New Roman
200
0
49152
[algn]
1
1
0
0
0
[spc]
33
273
1
0
0
1
100
[brk]
4
[line]
8
0
1
0
1
1
1
10
10
1
[spec]
0
0
0
1
1
0
0
0
0
[nfmt]
280
1
2
.
,
$
Body Text
0
0
[lay]
Standard
513
[rght]
15840
12240
1
1440
792
1
792
1440
0
1
0
1
0
2
1
1440
10800
12
1
720
1
1440
1
2160
1
2880
1
3600
1
4320
1
5040
1
5760
1
6480
1
7200
1
7920
1
8640
[hrght]
[lyfrm]
1
11200
0
0
12240
792
0
1
3
1 0 0 0 0 0 0
0
0
1
[frmlay]
792
12240
1
1440
0
1
792
1440
0
1
0
1
1
0
1
1440
10800
2
2
4680
3
9360
[txt]
>
[frght]
[lyfrm]
1
13248
0
15048
12240
15840
0
1
3
1 0 0 0 0 0 0
0
0
2
[frmlay]
15840
12240
1
1440
720
1
15120
1440
0
1
0
1
1
0
1
1440
10800
2
2
4680
3
9360
[txt]
>
[elay]
[l1]
0
[edoc]
<:#240,9360>Declare FontDlg(Action, Hdlg, id)
<:#240,9360>Declare CellEngine(Action,Formula)
<:#240,9360>
<:#240,9360>Define Descript "Enter the coefficients for the second order polynomial above: "
<:#240,9360>
<:#240,9360>Define AnswerHolder1 1007
<:#240,9360>Define AnswerHolder2 1006
<:#240,9360>Define DescriptHolder 1008
<:#240,9360>Define Complex "Complex root"
<:#240,9360>
@Subhead@<:#284,9360>Function Main()
<:#240,9360>MacName = GetRunningMacroFile$()
<:#240,9360>SetDlgCallBack(0, "{MacName}!InitDlg")
<:#240,9360>SetDlgCallBack(8001, "{MacName}!CallBack")
<:#240,9360>SetDlgCallBack(8000, "{MacName}!CallBack")
<:#240,9360>SetDlgCallBack(8002, "{MacName}!CallBack")
<:#240,9360>
<:#240,9360>FontDlg(1,0,0) 'Create font
<:#240,9360>
<:#240,9360>CellEngine(1,0) 'loads cell engine
<:#240,9360>FillEdit(DescriptHolder,Descript)
<:#240,9360>macpath = GetMacPath$()
<:#240,9360>FillEdit(1001,"{macpath}QkQuad.bmt")
<:#240,9360>
<:#240,9360>FillEdit(20,1)
@Outline3@<:#240,9360>DlgKeyInterrupt(112, "{macName}!DisplayHelp")
@Outline3@<:#240,9360>
<:#240,9360>box = DialogBox(".","QuickQuad")
<:#240,9360>'singlestep(1)
<:#240,9360>If box = 3 then 'user wants to copy
<:#240,9360> Answ1 = GetDialogField$(8003)
<:#240,9360> Answ2 = GetDialogField$(8004)
<:#240,9360> If GetDialogField$(20)
<:#240,9360> If (Answ1 <<<;> "")
<:#240,9360> ClipboardWrite("{Answ1}",1)
<:#240,9360> Else
<:#240,9360> ClipboardWrite("",1) 'if no real answer then clear the clipboard form last real result
<:#240,9360> Endif
<:#240,9360> ElseIf GetDialogField$(21)
<:#240,9360> If (Answ2 <<<;> "")
<:#240,9360> ClipboardWrite("{Answ2}",1)
<:#240,9360> Else
<:#240,9360> ClipboardWrite("",1) 'if no real answer then clear the clipboard form last real result
<:#240,9360> Endif
<:#240,9360> Endif
<:#240,9360>Endif
<:#240,9360>
<:#240,9360>FontDlg(4,0,0) 'Free font object
<:#240,9360>CellEngine(0,0) 'Unload cell engine
<:#240,9360>End Function
@Subhead@<:#284,9360>Function Callback(hdlg,id,val)
<:#240,9360>IgnoreKeyboard(2)
<:#240,9360> A = GetDlgItemText(hDlg, 8001)
<:#240,9360> B = GetDlgItemText(hDlg, 8000)
<:#240,9360> C = GetDlgItemText(hDlg, 8002)
<:#240,9360>
<:#240,9360>
<:#240,9360> Det = B*B - (4*A*C)
<:#240,9360>
<:#240,9360> if Det <;>= 0
<:#240,9360> Det = CellEngine(3, "@SQRT({Det})")
<:#240,9360> iFlag = 0
<:#240,9360> If (a != 0 and a !="") and Isnumeric(a)
<:#240,9360> Ans1 = ( -1* B - Det )/(2*A)
<:#240,9360> Ans2 = ( -1* B + Det )/(2*A)
<:#240,9360> Else
<:#240,9360> Ans1 = ""
<:#240,9360> Ans2 = ""
<:#240,9360> Endif
<:#240,9360>
<:#240,9360> Else
<:#240,9360> ' the roots are complex
<:#240,9360> Det = CellEngine(3, "@SQRT({-Det})")
<:#240,9360> iFlag = 1
<:#240,9360> Ans1 = Complex
<:#240,9360> Ans2 = Complex
<:#240,9360>
<:#240,9360> EndIf
<:#240,9360> SetDlgItemText( hDlg, AnswerHolder1,Ans1)
<:#240,9360> SetDlgItemText( hDlg, 8003,Ans1)
<:#240,9360>
<:#240,9360> SetDlgItemText( hDlg, AnswerHolder2,Ans2)
<:#240,9360> SetDlgItemText( hDlg,8004,Ans2)
<:#240,9360>
<:#240,9360>end function
@Subhead@<:#284,9360>
@Subhead@<:#284,9360>Function InitDlg(Hdlg, Id, Value)
<:#240,9360>For x = 1001 to 1008
<:#240,9360> FontDlg(3, Hdlg, x)
<:#240,9360>Next
<:#240,9360>FontDlg(3,Hdlg, 20)
<:#240,9360>FontDlg(3,Hdlg, 21)
<:#240,9360>'SetDlgItemText( hDlg 1011,Descript)
<:#240,9360>End Function
@Subhead@<:#284,9360>
@Subhead@<:#284,9360>function DisplayHelp()
@Outline2@<:#240,9360>' two defines needed for help. The help name and panel number are defined above
@Outline2@<:#240,9360>define FindWindowa() DllCall("user,FindWindow,HCC", %1, %2)
@Outline2@<:#240,9360>define WinHelpa(hWnd, file, cmd, ptr) DllCall("user,WinHelp,HHCHJ", %1, %2, %3, %4)
@Outline2@<:#240,9360>prohWnd = FindWindowa("AmiProWndA", 0)
@Outline2@<:#240,9360>helpfile = strcat$(GetAmiDirectory$(), "HelpPack.hlp")
@Outline2@<:#240,9360>PanelNum= 90
@Outline2@<:#240,9360>WinHelpa(prohWnd, helpfile, 0x0001, Panelnum)
@Outline2@<:#240,9360>end function
@Subhead@<:#284,9360>
@Subhead@<:#284,9360>
@Subhead@<:#284,9360>
<:#240,9360>
@Subhead@<:#284,9360>Function CellEngine(Action,Formula)
<:#240,9360>'Available Actions
<:#240,9360>' 1 Start the engine and allocate globalvar
<:#240,9360>' 2 Return the handle to the instance of the sheet
<:#240,9360>' 3 Pass the formula as the second paramater
<:#240,9360>' 0 Shut everything down
<:#240,9360>' Default Expect a formula and return an answer
<:#240,9360>
<:#240,9360>' these defines may be useful at the beginning of your macro
<:#240,9360>Define StartEngine 1
<:#240,9360>Define GetInstance 2
<:#240,9360>Define CloseEngine 0
<:#240,9360>
<:#240,9360>Define CECREATEINSTANCE(LPHANDLE) DllCall("LTSCE01.DLL,CECREATEINSTANCE,HO",%1)
<:#240,9360>Define CEDESTROYINSTANCE(HANDLE) DllCall("LTSCE01.DLL,CEDESTROYINSTANCE,HH",%1)
<:#480,9360>Define CECALCNOW(HINSTANCE, lpFormula, lpOutPut) DllCall("LTSCE01.DLL,CECALCNOW,HHCC",%1,%2,%3)
<:#240,9360>
<:#240,9360>DefStr hInstance, Answer, Var;
<:#240,9360>Mac = GetRunningMacroFile$()
<:#240,9360>GlobalInstance = StrCat$(Mac,"hIstance")
<:#240,9360>
<:#240,9360>Switch Action
<:#240,9360> Case 1
<:#240,9360> ' start the engine
<:#240,9360> LibId = DLLLoadLib("LTSCE01.DLL","CECreateInstance","HO")
<:#240,9360> If LibId = 0
<:#240,9360> Message("LTSCE01.DLL not found. Copy the dll to your windows directory")
<:#240,9360> Return -1;
<:#240,9360> Endif
<:#240,9360> RetVal = CECREATEINSTANCE(&hInstance)
<:#240,9360> AllocGlobalVar("{GlobalInstance}",1)
<:#240,9360> AllocGlobalVar("{Mac}LibId",1)
<:#240,9360> SetGlobalVar("{Mac}Libid",LibId)
<:#240,9360> SetGlobalVar("{GlobalInstance}",hInstance)
<:#240,9360> Return hInstance;
<:#240,9360> Break;
<:#240,9360>
<:#240,9360> Case 2
<:#240,9360> ' return the handle to the instance of the sheet
<:#240,9360> AllocGlobalVar("{GlobalInstance}",1)
<:#240,9360> hInstance = GetGlobalVar$("{GlobalInstance}")
<:#240,9360> Return hInstance;
<:#240,9360> Break;
<:#240,9360>
<:#240,9360> Case 3
<:#240,9360> ' Calculate the formula and return the answer
<:#240,9360> AllocGlobalVar("{GlobalInstance}",1)
<:#240,9360> hInstance = GetGlobalVar$("{GlobalInstance}")
<:#240,9360> CECalcNow(hInstance,"{Formula}",&Answer)
<:#240,9360> Return Answer;
<:#240,9360> Break;
<:#240,9360>
<:#240,9360>
<:#240,9360> Case 0
<:#240,9360> ' destroy the instance of the sheet and free the global var and libid
<:#240,9360> AllocGlobalVar("{GlobalInstance}",1)
<:#240,9360> AllocGlobalVar("{Mac}LibId",1)
<:#240,9360> hInstance = GetGlobalVar$("{GlobalInstance}")
<:#240,9360> LibId = GetGlobalVar$("{Mac}LibId")
<:#240,9360> If hInstance
<:#240,9360> CEDestroyInstance(hInstance)
<:#240,9360> DllFreeLib(Libid)
<:#240,9360> Endif
<:#240,9360> FreeGlobalVar("{GlobalInstance}")
<:#240,9360> FreeGlobalVar("{Mac}LibId")
<:#240,9360> Break;
<:#240,9360>
<:#240,9360> Default
<:#240,9360>EndSwitch
<:#240,9360>End Function
@Subhead@<:#284,9360>
@Subhead@<:#284,9360>
@Subhead@<:#284,9360>Function FontDlg(Action, Hdlg, id)
<:#240,9360>' 1 Create a font and allocvar
<:#240,9360>' 2 Return the handle of the create font
<:#240,9360>' 3 Set the id specified to the font
<:#240,9360>' 4 Freeglobalvar and delete created object
<:#240,9360>
@Outline2@<:#480,9360>define CreateFontDLG() DllCall("gdi,CreateFont,HHHHHHHHHHHHHHC", %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14)
@Outline2@<:#240,9360>define DeleteObjectDLG(handle) DllCall("gdi,DeleteObject,HH", %1)
@Outline2@<:#480,9360>define SendMessageDLG(hwnd, msg, wpara, lparm) DllCall("user,SendMessage,HHHHJ", %1, %2, %3, %4)
@Outline2@<:#240,9360>
@Outline2@<:#240,9360>
<:#240,9360>Switch Action
<:#240,9360> Case 1 ' Create the font and store it
@Outline2@<:#240,9360> Font = CreateFontDLG(13, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv")
<:#240,9360> AllocGlobalVar("FontHandle",1)
<:#240,9360> If Font
<:#240,9360> SetGlobalVar("FontHandle",Font)
<:#240,9360> Return Font
<:#240,9360> Else
<:#240,9360> Return 0; ' no font
<:#240,9360> Endif
<:#240,9360> Break;
<:#240,9360> Case 2 ' Return the handle to the font
<:#240,9360> Handle = GetGlobalVar$("FontHandle")
<:#240,9360> If Handle
<:#240,9360> Return Handle
<:#240,9360> Else
<:#240,9360> Return 0
<:#240,9360> Endif
<:#240,9360>
<:#240,9360> Case 3 ' Set the id to the font
<:#240,9360> Handle = GetGlobalVar$("FontHandle")
<:#240,9360> If Handle
<:#240,9360> IdControl = GetDlgITem(Hdlg, id)
<:#240,9360> SendMessageDlg(idControl, 0x30, Handle, 0)
<:#240,9360> Return 1
<:#240,9360> Else
<:#240,9360> Return 0
<:#240,9360> Endif
<:#240,9360> Break;
<:#240,9360>
<:#240,9360> Case 4 ' Delete the font and clear the var
<:#240,9360> Handle = GetGlobalVar$("FontHandle")
<:#240,9360> If Handle
<:#240,9360> DeleteObjectDLG(Handle)
<:#240,9360> Stat = 1
<:#240,9360> Else
<:#240,9360> Stat = 0
<:#240,9360> Endif
<:#240,9360> FreeGlobalVar("FontHandle")
<:#240,9360> Return Stat
<:#240,9360> Default
<:#240,9360> Message("Fontdlg received an invalid parameter {Action}")
<:#240,9360>EndSwitch
<:#240,9360>
<:#240,9360>End Function
@Subhead@<:#284,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
<:#240,9360>
DIALOG QuickQuad
-2134376448 17 59 39 136 91 "" "AmiDialog" "QuickQuadratic"
FONT 8 "Helv"
19 46 29 11 8001 1350631424 "edit" "" 0
19 60 29 11 8000 1350631424 "edit" "" 0
19 74 29 11 8002 1350631552 "edit" "" 0
93 3 40 14 1 1342373889 "button" "Done" 0
93 19 40 14 3 1342373888 "button" "Copy" 0
61 59 43 8 20 1342242825 "button" "Answer 1=" 0
61 68 42 11 21 1342242825 "button" "Answer 2=" 0
4 4 63 12 1001 1342177290 "static" "" 0
7 49 9 10 1002 1342177280 "static" "A:" 0
7 63 9 10 1003 1342177280 "static" "B:" 0
7 77 9 10 1004 1342177280 "static" "C:" 0
56 49 40 8 1005 1342177280 "static" "Solve for x:" 0
105 70 23 9 1006 1342177280 "static" "" 0
105 60 23 9 1007 1342177280 "static" "" 0
7 19 62 24 1008 1342177280 "static" "" 0
252 35 40 12 8003 1350631552 "edit" "" 0
292 35 36 12 8004 1350631552 "edit" "" 0
END DIALOG
>
[Embedded]
00012988
>
[macsum] 7
Main 0 0 6 10
Callback 678 3 9 50
InitDlg 1333 3 2 86
DisplayHelp 1533 0 4 95
CellEngine 1718 2 8 108
FontDlg 2665 3 5 180
QuickQuad 3511 0 -1 273
[macse]
14 Main
0 802
13
8 1
0 41 0 "{1}!InitDlg"
0 41 8001 "{1}!CallBack"
0 41 8000 "{1}!CallBack"
0 41 8002 "{1}!CallBack"
16 FontDlg 1 0 0
16 CellEngine 1 0
0 31 1008 "Enter the coefficients for the second order polynomial above: "
0 295
13
8 2
0 31 1001 "{2}QkQuad.bmt"
0 31 20 1
0 47 112 "{1}!DisplayHelp"
0 26 "." "QuickQuad"
13
8 3
6 3
5 3
18 0
11 00000629
0 27 8003
13
8 4
0 27 8004
13
8 5
0 27 20
13
11 00000531
6 4
7 ""
18 1
11 00000505
0 1038 "{4}" 1
10 00000518
0 1038 "" 1
10 00000629
0 27 21
13
11 00000629
6 5
7 ""
18 1
11 00000616
0 1038 "{5}" 1
10 00000629
0 1038 "" 1
16 FontDlg 4 0 0
16 CellEngine 0 0
6 0
15
9
14 Callback
0 32 2
0 42 "{0}" 8001
13
8 4
0 42 "{0}" 8000
13
8 5
0 42 "{0}" 8002
13
8 6
6 5
6 5
4 0
5 4
6 4
4 0
6 6
4 0
3 1
8 7
6 7
5 0
18 2
11 00000452
16 CellEngine 3 "@SQRT({7})"
13
8 7
5 0
8 8
6 4
5 0
18 1
6 4
7 ""
18 1
1 1
0 277 "{4}"
13
1 1
11 00000416
5 -1
6 5
4 0
6 7
3 1
5 2
6 4
4 0
4 1
8 9
5 -1
6 5
4 0
6 7
3 0
5 2
6 4
4 0
4 1
8 10
10 00000439
7 ""
8 9
7 ""
8 10
10 00000549
16 CellEngine 3 "@SQRT({11})"
13
8 7
5 1
8 8
7 "Complex root"
8 9
7 "Complex root"
8 10
0 43 "{0}" 1007 "{9}"
0 43 "{0}" 8003 "{9}"
0 43 "{0}" 1006 "{10}"
0 43 "{0}" 8004 "{10}"
6 3
15
9
14 InitDlg
5 1001
8 4
5 1008
6 4
18 2
12 00000103
10 00000142
5 1
6 4
3 0
8 4
10 00000025
16 FontDlg 3 "{0}" "{4}"
10 00000070
16 FontDlg 3 "{0}" 20
16 FontDlg 3 "{0}" 21
6 3
15
9
14 DisplayHelp
0 284 "user,FindWindow,HCC" "AmiProWndA" 0
13
8 1
0 798
13
0 16 [X] "HelpPack.hlp"
13
8 2
5 90
8 3
0 284 "user,WinHelp,HHCHJ" "{1}" "{2}" 1 "{3}"
6 0
15
9
14 CellEngine
0 802
13
8 6
0 16 "{6}" "hIstance"
13
8 7
5 1
6 0
18 0
11 00000427
0 297 "LTSCE01.DLL" "CECreateInstance" "HO"
13
8 8
6 8
5 0
18 0
11 00000258
0 3 "LTSCE01.DLL not found. Copy the dll to your windows directory"
5 -1
15
9
0 284 "LTSCE01.DLL,CECREATEINSTANCE,HO" &3
13
8 9
0 271 "{7}" 1
0 271 "{6}LibId" 1
0 264 "{6}Libid" "{8}"
0 264 "{7}" "{3}"
6 3
15
9
10 00000935
10 00000935
5 2
6 0
18 0
11 00000531
0 271 "{7}" 1
0 265 "{7}"
13
8 3
6 3
15
9
10 00000935
10 00000935
5 3
6 0
18 0
11 00000686
0 271 "{7}" 1
0 265 "{7}"
13
8 3
0 284 "LTSCE01.DLL,CECALCNOW,HHCC" "{3}" "{1}" &4
6 4
15
9
10 00000935
10 00000935
5 0
6 0
18 0
11 00000935
0 271 "{7}" 1
0 271 "{6}LibId" 1
0 265 "{7}"
13
8 3
0 265 "{6}LibId"
13
8 8
6 3
11 00000878
0 284 "LTSCE01.DLL,CEDESTROYINSTANCE,HH" "{3}"
0 298 "{8}"
0 266 "{7}"
0 266 "{6}LibId"
10 00000935
10 00000935
6 2
15
9
14 FontDlg
5 1
6 0
18 0
11 00000255
0 284 "gdi,CreateFont,HHHHHHHHHHHHHHC" 13 0 0 0 400 0 0 0 0 0 0 0 0 "Helv"
13
8 4
0 271 "FontHandle" 1
6 4
11 00000217
0 264 "FontHandle" "{4}"
6 4
15
9
10 00000229
5 0
15
9
10 00000834
10 00000834
5 2
6 0
18 0
11 00000381
0 265 "FontHandle"
13
8 5
6 5
11 00000356
6 5
15
9
10 00000368
5 0
15
9
10 00000834
5 3
6 0
18 0
11 00000596
0 265 "FontHandle"
13
8 5
6 5
11 00000558
0 44 "{1}" "{2}"
13
8 6
0 284 "user,SendMessage,HHHHJ" "{6}" 48 "{5}" 0
5 1
15
9
10 00000570
5 0
15
9
10 00000834
10 00000834
5 4
6 0
18 0
11 00000785
0 265 "FontHandle"
13
8 5
6 5
11 00000730
0 284 "gdi,DeleteObject,HH" "{5}"
5 1
8 7
10 00000740
5 0
8 7
0 266 "FontHandle"
6 7
15
9
10 00000834
0 3 "Fontdlg received an invalid parameter {0}"
6 3
15
9
DIALOG QuickQuad
-2134376448 17 59 39 136 91 "" "AmiDialog" "QuickQuadratic"
FONT 8 "Helv"
19 46 29 11 8001 1350631424 "edit" "" 0
19 60 29 11 8000 1350631424 "edit" "" 0
19 74 29 11 8002 1350631552 "edit" "" 0
93 3 40 14 1 1342373889 "button" "Done" 0
93 19 40 14 3 1342373888 "button" "Copy" 0
61 59 43 8 20 1342242825 "button" "Answer 1=" 0
61 68 42 11 21 1342242825 "button" "Answer 2=" 0
4 4 63 12 1001 1342177290 "static" "" 0
7 49 9 10 1002 1342177280 "static" "A:" 0
7 63 9 10 1003 1342177280 "static" "B:" 0
7 77 9 10 1004 1342177280 "static" "C:" 0
56 49 40 8 1005 1342177280 "static" "Solve for x:" 0
105 70 23 9 1006 1342177280 "static" "" 0
105 60 23 9 1007 1342177280 "static" "" 0
7 19 62 24 1008 1342177280 "static" "" 0
252 35 40 12 8003 1350631552 "edit" "" 0
292 35 36 12 8004 1350631552 "edit" "" 0
00013013